<%--
  Created by IntelliJ IDEA.
  User: chue
  Date: 4/3/11
  Time: 3:05 PM
  To change this template use File | Settings | File Templates.
--%>

<%@ page import="com.cgah.Constants" contentType="text/html;charset=UTF-8" %>
<div class="nav" style="margin-top:0px; border-bottom:none; font-size:1.1em; font-weight:bolder;">
    <span class="spacer"></span>

    <sec:ifNotLoggedIn>
        <span>Welcome to Coo Coo Genius Auction House</span>
        <span class="menuButton" style="float:right;">
            <g:link class="register" action="index" controller="user" style="white-space:nowrap;">Register</g:link>
            <g:link class="login" controller="login" action="index">My Account</g:link>
        </span>
    </sec:ifNotLoggedIn>

    <sec:ifLoggedIn>
        %{--NOTE: an account that has both admin and user roll will break this--}%
        <sec:ifAnyGranted roles="${Constants.ROLE_ADMIN}">
            <span>Welcome
            <g:link style="margin-left:20px" class="customer" controller="customer" action="list">
                <sec:loggedInUserInfo field="username"/>
            </g:link>
            </span>
        </sec:ifAnyGranted>
        <sec:ifAnyGranted roles="${Constants.ROLE_USER}">
            <span>Welcome
            <g:link style="margin-left:20px" class="customer" controller="user" action="show" id="${applicationContext.springSecurityService.currentUser.id}">
                <sec:loggedInUserInfo field="username"/>
            </g:link>
            </span>
        </sec:ifAnyGranted>

         <span class="menuButton" style="float:right;">
                <g:link class="logout" action="logout" controller="logout">Logout</g:link>
         </span>
    </sec:ifLoggedIn>

</div>

<div id="grailsLogo" style="vertical-align:middle;padding:2px;">
    <table style="border-collapse: collapse; height: 100%; border-spacing: 0px;border-style:none;">
        <tr>
            <td style="width:1%;padding-right:20px;">
                <a href="http://grails.org">
                    <img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails" border="0"/>
                </a>
            </td>
            <td style="width:99%;">
                <div>
                    Some really really really cool attention grabbing advertisement goes here<br/>
                    Hopefully it doesn't drive the customers away and cause lots of loading lag!!<br/>
                    Makes you think doesn't it!!<br/>
                </div>
            </td>
        </tr>

    </table>
</div>



